package cn.dakaqi.entities;

import cn.dakaqi.entities.user.Volunteer;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by chunyang on 2016/4/18.
 * 活动日记
 */

@Entity
@Table(name = "U_ACTIVITY_DIARY")
public class ActivityDiary extends IdEntity
{

    private static final long serialVersionUID = -1968215243260419908L;
    private Activity activity;
    private Volunteer volunteer;
    private Group group;
    private String message;
    private String imgs;
    private int type; //好2、中1、差评论-1
    private Date createTime;

    public ActivityDiary()
    {
    }

    public ActivityDiary(Long id)
    {
        this.id = id;
    }

    @ManyToOne
    @JoinColumn(name = "ACTIVITY_ID")
    @JsonIgnore
    public Activity getActivity()
    {
        return activity;
    }

    public void setActivity(Activity activity)
    {
        this.activity = activity;
    }

    @ManyToOne
    @JoinColumn(name = "VOLUNTEER_ID")
    @JsonIgnore
    public Volunteer getVolunteer()
    {
        return volunteer;
    }

    public void setVolunteer(Volunteer volunteer)
    {
        this.volunteer = volunteer;
    }

    @ManyToOne
    @JoinColumn(name = "GROUP_ID")
    @JsonIgnore
    public Group getGroup()
    {
        return group;
    }

    public void setGroup(Group group)
    {
        this.group = group;
    }

    public String getMessage()
    {
        return message;
    }

    public void setMessage(String message)
    {
        this.message = message;
    }

    public String getImgs()
    {
        return imgs;
    }

    public void setImgs(String imgs)
    {
        this.imgs = imgs;
    }

    public int getType()
    {
        return type;
    }

    public void setType(int type)
    {
        this.type = type;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getCreateTime()
    {
        return createTime;
    }

    public void setCreateTime(Date createTime)
    {
        this.createTime = createTime;
    }
}
